package repository

import (
	"context"
	"ruoyi-go-echo-ddd/internal/domain/model"
	"ruoyi-go-echo-ddd/internal/infrastructure/http/request"
)

type SysMenuRepository interface {
	Insert(ctx context.Context, sysMenu *model.SysMenu) (*model.SysMenu, error)
	Update(ctx context.Context, sysMenu *model.SysMenu) (int64, error)
	BatchInsert(ctx context.Context, list []*model.SysMenu) ([]int64, error)
	SelectById(ctx context.Context, id int64) (*model.SysMenu, error)
	SelectList(ctx context.Context, param *request.MenuPageParam) ([]*model.SysMenu, error)
	SelectPage(ctx context.Context, param *request.MenuPageParam) ([]*model.SysMenu, int64, int64, error)
	BatchDelete(ctx context.Context, ids []any) (int64, error)
	SelectListByUserId(ctx context.Context, userId int64, menuName, visible, beginTime, endTime string) ([]*model.SysMenu, error)
	SelectMenuPermsByUserId(ctx context.Context, userId int64) ([]string, error)
	SelectTreeAll(ctx context.Context) ([]*model.SysMenu, error)
	SelectTreeByUserId(ctx context.Context, userId int64) ([]*model.SysMenu, error)
	// BuildMenus 构建前端路由所需要的菜单 构建前端路由所需要的菜单
	BuildMenus(menuList []*model.SysMenu) ([]*model.RouterVo, error)
	// BuildMenuTree 构建前端所需要树结构
	BuildMenuTree(menuList []*model.SysMenu) ([]*model.SysMenu, error)
	SelectMenuList(ctx context.Context, menu *model.SysMenu) ([]*model.SysMenu, error)
	SelectMenuListMenuAndUserId(ctx context.Context, menu *model.SysMenu, userId int64) ([]*model.SysMenu, error)
	SelectListByMenuAndUserId(ctx context.Context, menu *model.SysMenu, userId int64) ([]*model.SysMenu, error)
	BuildMenuTreeSelect(menuList []*model.SysMenu) []*model.TreeSelect
	BuildRoleMenuTreeSelect(ctx context.Context, userId, roleId int64) (*model.RoleMenuTreeSelect, error)
	SelectMenuListByRoleId(ctx context.Context, roleId int64) ([]int64, error)
}